/**
 * 
 */
package edu.ou.cs.youming.jaxb.types;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author Youming Lin
 * 
 */
@XmlRootElement(name = "Example")
public final class Example {
	@XmlElement(name = "polarity")
	public final Label polarity;

	@XmlElement(name = "tweet")
	public final Tweet tweet;

	protected Example() {
		polarity = null;
		tweet = null;
	}

	public Example(final Label polarity, final Tweet tweet) {
		if (polarity == null) {
			throw new NullPointerException("polarity");
		}

		if (tweet == null) {
			throw new NullPointerException("tweet");
		}

		this.polarity = polarity;
		this.tweet = tweet;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Example [polarity=" + polarity + ", tweet=" + tweet + "]";
	}
}